package com.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

public class FileOutputInputStreamDemo01 {
    public static void main(String[] args) throws
            IOException {

        FileInputStream fileInputStream = new FileInputStream("D:\\dev\\1\\fout.txt");
        FileOutputStream fileOutputStream = new FileOutputStream(
                "D:\\dev\\1\\fout2.txt");

        byte[] buff = new byte[20];
        int len = fileInputStream.read(buff);
        while(len>0) {
            fileOutputStream.write(buff,0,len);
            len = fileInputStream.read(buff);
        }

        fileOutputStream.close();
        fileInputStream.close();

    }
}
